package com.vhall.component.controller.room;

import com.vhall.component.controller.room.facade.CallBackFacade;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.plugin.common.annotation.PaasCallbackSignAuth;
import com.vhall.component.service.room.CallBackService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;

/**
 * @author guoxin.wang
 * @date 2021/7/12 17:30
 */
@Slf4j
@VhallComponent
public class CallBackController implements CallBackFacade {

    private static final String SUCCESS = "success";

    @Autowired
    private CallBackService callBackService;

    @PaasCallbackSignAuth
    @Override
    public String index(Map<String, Object> callBack) {
        callBackService.liveCallbackHandler(callBack);
        return SUCCESS;
    }

    @Override
    @PaasCallbackSignAuth
    public String liveIndex(Map<String, Object> callBack) {
        return callBackService.liveIndex(callBack);
    }

    @Override
    @PaasCallbackSignAuth
    public String recordIndex(Map<String, Object> callBack) {
        return callBackService.recordIndex(callBack);
    }
}
